{include file="common/head"/}  
<div class="main">
    <div class="userinfo"> 
        <div class="infos"> 
            <li><span class="name">姓名：</span><span class="value">{$userInfo.username}</span></li>
            <li><span class="name">手机：</span><span class="value">{$userInfo.mobile}</span></li> 
            <li><span class="name">等级：</span><span class="value">{$userInfo.level_name}</span></li>  
            <li><span class="name">上级：</span><span class="value">{$agentname}</span></li>   
        </div> 
    </div>  
    <div class="home_pan">
        {if $userInfo.state===0}
            <div class="layui-btn layui-btn-fluid" id="trade" data-type="reload"><i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop">&#xe63d;</i> 交易中，点击停止交易</div>
        {else if $userInfo.state===1}
            <div class="layui-btn layui-btn-fluid layui-btn-danger" id="trade" data-type="reload"><i class="layui-icon">&#xe63d;</i> 停止交易，点击启动交易</div>
        {/if} 
        <div style="padding-top: 15px; overflow: hidden;">
        {if $userInfo.voice=='open'}
            <div class="layui-btn layui-btn-fluid" id="voice" data-type="reload"><i class="layui-icon">&#xe645;</i> 提示音开启，点击关闭</div> 
        {else if $userInfo.voice=='close'}
            <div class="layui-btn layui-btn-danger layui-btn-fluid" id="voice" data-type="reload"><i class="layui-icon">&#xe688;</i> 提示音关闭，点击开启</div>
        {/if}
        </div>
    </div> 

<div id="homenav">
    <ul> 
        {$dailinav|raw}
        <li><a href="{:url('user/channel/index')}"><i class="layui-icon">&#xe857;</i> 通道管理</a></li>
        <li><a href="{:url('user/order/index')}"><i class="layui-icon">&#xe63c;</i> 订单管理</a></li>
        <li><a href="{:url('user/settle/index')}" ><i class="layui-icon">&#xe65e;</i> 提现管理</a></li>
        <li><a href="{:url('user/financial/index')}"><i class="layui-icon">&#xe65e;</i> 财务管理</a></li>
        <li><a href="{:url('user/financial/bank')}"><i class="icon icon-credit-card"></i> 收款账号</a></li>
        <li><a href="{:url('user/set/index')}"><i class="layui-icon">&#xe673;</i> 修改密码</a></li>
        <li><a href="{:url('user/index/logout')}"><i class="layui-icon">&#xe65c;</i> 退出登录</a></li>
    </ul>
</div> 

    <div class="home_pan">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
                <div class="layui-card">
                    <div class="layui-card-header"><i class="layui-icon">&#xe63c;</i>订单统计<em class="pull-right">单位：个</em></div>
                    <div class="layui-card-body">
                        <div class="layui-col-xs6"><span class="name">待处理</span><span class="value">{$cdata.order_no}</span></div> 
                        <div class="layui-col-xs6"><span class="name">全部订单</span><span class="value">{$cdata.order_all}</span></div>  
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
                <div class="layui-card">
                    <div class="layui-card-header"><i class="layui-icon">&#xe65e;</i>财务汇总<em class="pull-right">单位：元</em></div>
                    <div class="layui-card-body">
                        <div class="layui-col-xs6"><span class="name">累计收款</span><span class="value">{$cdata.order_money}</span></div>   
                        <div class="layui-col-xs6"><span class="name">支付手续费</span><span class="value">{$cdata.order_money_pay}</span></div> 
                    </div>
                </div>
            </div>
            <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
                <div class="layui-card">
                    <div class="layui-card-header"><i class="layui-icon">&#xe857;</i>通道统计<em class="pull-right">单位：个</em></div>
                    <div class="layui-card-body">
                        <div class="layui-col-xs6"><span class="name">激活的通道</span><span class="value">{$cdata.channel_yes}</span></div> 
                        <div class="layui-col-xs6"><span class="name">全部通道</span><span class="value">{$cdata.channel_all}</span></div>    
                    </div>
                </div>
            </div>
        </div>
    </div> 
</div>
<script type="text/html" id="action">
    {{# if(d.state==0 && d.points==0){ }}
        <div class="layui-btn layui-btn-danger layui-btn-xs" lay-event="orderdel">删除</div>
    {{# }else{ }}
        <div class="layui-btn layui-btn-disabled layui-btn-xs">删除</div>
    {{# } }} 
</script>
<script type="text/html" id="payinfo"> 
    {{# if(d.bankid){ }}<div onmouseover="layer.tips('{{d.bank_name}}<br>收款账号：{{d.bank_no}}<br>支付时间：{{d.paytime}}',this,{area: 'auto',tips: [1, '#333']});" onmouseout="layer.closeAll();">{{d.payname}}</div>{{# } }} 
</script>
{include file="common/footer"/}  
<script>
    layui.use(['table','form'], function() {
        var table = layui.table,form = layui.form, $ = layui.jquery; 
        $('#trade').on('click', function () {  
            var userid="{$userInfo.id}";
            var state="{$userInfo.state}";
            $.post("{:url('index/userstrade')}",{userid:userid,state:state},function(res){
                if(res.status===1){
                    layer.msg(res.msg,{time:1000,icon:1},function(){ 
                        parent.location.reload();
                    });
                }else{
                    layer.msg(res.msg,{time:1000,icon:2});
                }
            });
        });

        $('#voice').on('click', function () {  
            var userid="{$userInfo.id}";
            var voice="{$userInfo.voice}";
            $.post("{:url('index/usersvoice')}",{userid:userid,voice:voice},function(res){
                if(res.status===1){
                    layer.msg(res.msg,{time:1000,icon:1},function(){ 
                        parent.location.reload();
                    });
                }else{
                    layer.msg(res.msg,{time:1000,icon:2});
                }
            });
        });
    });  
</script>
</body>
</html>